<extend name="Layout/application"/>

<!-- content start -->
<block name="content">
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">新增课程</strong> /
                    <small>Create A New Course</small>
                </div>
            </div>

            <hr>
            <form class="am-form" action="{{:URL('update',['id'=>$course.id])}}" method="post">
                <div data-am-tabs>

                    <div class="am-tabs-bd">
                        <div class="am-form am-tab-panel am-fade am-in am-active" id="tab1">


                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">课程名称</div>
                                <div class="am-u-sm-8 am-u-md-3 am-u-end col-end">
                                    <input type="text" class="am-input-sm" name="name" value="{{$course.name}}">
                                </div>
                            </div>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">价格</div>
                                <div class="am-u-sm-8 am-u-md-3 am-u-end col-end">
                                    <input type="text" class="am-input-sm" name="price" value="{{$course.price}}">
                                </div>
                            </div>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">
                                    图片
                                </div>
                                <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                                    <div class="am-form-group am-form-file new_thumb">
                                        <button type="button" class="am-btn am-btn-success am-btn-sm">
                                            <i class="am-icon-cloud-upload" id="loading"></i> 上传新的图片
                                        </button>
                                        <input type="file" id="image_upload">
                                        <input type="hidden" name="photo_id" value="{{$course.photo_id}}">
                                    </div>
                                    <hr data-am-widget="divider" style="" class="am-divider am-divider-dashed"/>

                                    <div>
                                        <img src="{{$course.photo.image}}"
                                             id="img_show" style="max-height: 200px;">
                                    </div>
                                </div>
                            </div>


                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">标签</div>
                                <div class="am-u-sm-12 am-u-md-12 am-u-end col-end">

                                    <div class="am-panel am-panel-default" style="margin-left: 163px">
                                        <volist name="views" id="view">
                                            <div class="am-panel-bd">
                                                <div class="am-g am-margin-top">
                                                    <div class="am-u-sm-4 am-u-md-3 am-text-right p2">
                                                        <label class="am-checkbox-inline">
                                                            <span class="am-badge am-badge-danger am-radius am-text-default">{{$view.name}}</span>
                                                        </label>
                                                    </div>
                                                    <div class="am-u-sm-5 am-u-md-9 am-u-end col-end ">
                                                        <volist name="view.tags" id="tag">
                                                            <label class="am-checkbox-inline">
                                                                <input type="checkbox" name="tag_id[]"
                                                                       value="{{$tag.id}}"
                                                                <in name="tag.id" value="$param">
                                                                    checked
                                                                </in>
                                                                >
                                                                <span class="am-badge am-badge-success am-radius am-text-sm">
                                                                {{$tag.name}}
                                                                </span>
                                                            </label>
                                                        </volist>
                                                    </div>
                                                </div>
                                            </div>
                                        </volist>
                                    </div>
                                </div>
                            </div>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">适合人群</div>
                                <div class="am-u-sm-8 am-u-md-8  ">
                                    <textarea name="target" cols="1" rows="1">{{$course.target}}</textarea>
                                </div>

                                <div class="am-u-sm-8 am-u-md-8 am-u-end col-end"
                                     style="margin-left: 163px;margin-top: 5px">
                                    <textarea name="target_body" cols="2" rows="2">{{$course.target_body}}</textarea>
                                </div>
                            </div>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">推荐</div>
                                <div class="am-u-sm-8 am-u-md-10">
                                    <div class="am-btn-group">
                                        <label class="am-radio-inline">
                                            <input type="radio" value="1" name="best"
                                            <eq name="course.best" value="1"> checked</eq>
                                            > 是
                                        </label>
                                        <label class="am-radio-inline">
                                            <input type="radio" value="0" name="best"
                                            <eq name="course.best" value="0"> checked</eq>
                                            > 否
                                        </label>
                                    </div>
                                </div>
                            </div>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">发布</div>
                                <div class="am-u-sm-8 am-u-md-10">
                                    <div class="am-btn-group">
                                        <label class="am-radio-inline">
                                            <input type="radio" value="1" name="publish"
                                            <eq name="course.best" value="1"> checked</eq>
                                            > 是
                                        </label>
                                        <label class="am-radio-inline">
                                            <input type="radio" value="0" name="publish"
                                            <eq name="course.best" value="0"> checked</eq>
                                            > 否
                                        </label>
                                    </div>
                                </div>
                            </div>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">完结</div>
                                <div class="am-u-sm-8 am-u-md-10">
                                    <div class="am-btn-group">
                                        <label class="am-radio-inline">
                                            <input type="radio" value="1" name="complete"
                                            <eq name="course.best" value="1"> checked</eq>
                                            > 是
                                        </label>
                                        <label class="am-radio-inline">
                                            <input type="radio" value="0" name="complete"
                                            <eq name="course.best" value="0"> checked</eq>
                                            > 否
                                        </label>
                                    </div>
                                </div>
                            </div>


                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">描述</div>
                                <div class="am-u-sm-8 am-u-md-3 am-u-end col-end">
                                    <textarea name="body" id="" cols="11" rows="7">{{$course.body}}</textarea>
                                </div>
                            </div>


                        </div>

                    </div>
                </div>
                <div class="am-margin">
                    <button type="submit" class="am-btn am-btn-primary am-radius">提交保存</button>
                </div>

        </div>
        </form>

    </div>
    </div>

    <footer class="admin-content-footer">
        <hr>
        <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
    </footer>
    <!-- content end -->
</block>
<block name="js">

    <script src="/vendor/html5-fileupload/jquery.html5-fileupload.js"></script>
    <script src="/vendor/html5-fileupload/upload.js"></script>


</block>


